\(\int \frac {\sin ^3(x)}{i+\tan (x)} \, dx\) [2]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [A] (verification not implemented)
   Maxima [F(-2)]
   Giac [B] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 13, antiderivative size = 29 \[ \int \frac {\sin ^3(x)}{i+\tan (x)} \, dx=\frac {1}{3} i \cos ^3(x)-\frac {1}{5} i \cos ^5(x)+\frac {\sin ^5(x)}{5} \]

[Out]

1/3*I*cos(x)^3-1/5*I*cos(x)^5+1/5*sin(x)^5

Rubi [A] (verified)

Time = 0.20 (sec) , antiderivative size = 29, normalized size of antiderivative = 1.00, number of steps used = 9, number of rules used = 7, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.538, Rules used = {3599, 3187, 3186, 2645, 14, 2644, 30} \[ \int \frac {\sin ^3(x)}{i+\tan (x)} \, dx=\frac {\sin ^5(x)}{5}-\frac {1}{5} i \cos ^5(x)+\frac {1}{3} i \cos ^3(x) \]

[In]

Int[Sin[x]^3/(I + Tan[x]),x]

[Out]

(I/3)*Cos[x]^3 - (I/5)*Cos[x]^5 + Sin[x]^5/5

Rule 14

Int[(u_)*((c_.)*(x_))^(m_.), x_Symbol] :> Int[ExpandIntegrand[(c*x)^m*u, x], x] /; FreeQ[{c, m}, x] && SumQ[u]
 &&  !LinearQ[u, x] &&  !MatchQ[u, (a_) + (b_.)*(v_) /; FreeQ[{a, b}, x] && InverseFunctionQ[v]]

Rule 30

Int[(x_)^(m_.), x_Symbol] :> Simp[x^(m + 1)/(m + 1), x] /; FreeQ[m, x] && NeQ[m, -1]

Rule 2644

Int[cos[(e_.) + (f_.)*(x_)]^(n_.)*((a_.)*sin[(e_.) + (f_.)*(x_)])^(m_.), x_Symbol] :> Dist[1/(a*f), Subst[Int[
x^m*(1 - x^2/a^2)^((n - 1)/2), x], x, a*Sin[e + f*x]], x] /; FreeQ[{a, e, f, m}, x] && IntegerQ[(n - 1)/2] &&
 !(IntegerQ[(m - 1)/2] && LtQ[0, m, n])

Rule 2645

Int[(cos[(e_.) + (f_.)*(x_)]*(a_.))^(m_.)*sin[(e_.) + (f_.)*(x_)]^(n_.), x_Symbol] :> Dist[-(a*f)^(-1), Subst[
Int[x^m*(1 - x^2/a^2)^((n - 1)/2), x], x, a*Cos[e + f*x]], x] /; FreeQ[{a, e, f, m}, x] && IntegerQ[(n - 1)/2]
 &&  !(IntegerQ[(m - 1)/2] && GtQ[m, 0] && LeQ[m, n])

Rule 3186

Int[cos[(c_.) + (d_.)*(x_)]^(m_.)*sin[(c_.) + (d_.)*(x_)]^(n_.)*(cos[(c_.) + (d_.)*(x_)]*(a_.) + (b_.)*sin[(c_
.) + (d_.)*(x_)])^(p_.), x_Symbol] :> Int[ExpandTrig[cos[c + d*x]^m*sin[c + d*x]^n*(a*cos[c + d*x] + b*sin[c +
 d*x])^p, x], x] /; FreeQ[{a, b, c, d, m, n}, x] && IGtQ[p, 0]

Rule 3187

Int[cos[(c_.) + (d_.)*(x_)]^(m_.)*sin[(c_.) + (d_.)*(x_)]^(n_.)*(cos[(c_.) + (d_.)*(x_)]*(a_.) + (b_.)*sin[(c_
.) + (d_.)*(x_)])^(p_), x_Symbol] :> Dist[a^p*b^p, Int[(Cos[c + d*x]^m*Sin[c + d*x]^n)/(b*Cos[c + d*x] + a*Sin
[c + d*x])^p, x], x] /; FreeQ[{a, b, c, d, m, n}, x] && EqQ[a^2 + b^2, 0] && ILtQ[p, 0]

Rule 3599

Int[sin[(e_.) + (f_.)*(x_)]^(m_.)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(n_.), x_Symbol] :> Int[Sin[e + f*x]^
m*((a*Cos[e + f*x] + b*Sin[e + f*x])^n/Cos[e + f*x]^n), x] /; FreeQ[{a, b, e, f}, x] && IntegerQ[(m - 1)/2] &&
 ILtQ[n, 0] && ((LtQ[m, 5] && GtQ[n, -4]) || (EqQ[m, 5] && EqQ[n, -1]))

Rubi steps \begin{align*} \text {integral}& = \int \frac {\cos (x) \sin ^3(x)}{i \cos (x)+\sin (x)} \, dx \\ & = -\left (i \int \cos (x) (\cos (x)+i \sin (x)) \sin ^3(x) \, dx\right ) \\ & = -\left (i \int \left (\cos ^2(x) \sin ^3(x)+i \cos (x) \sin ^4(x)\right ) \, dx\right ) \\ & = -\left (i \int \cos ^2(x) \sin ^3(x) \, dx\right )+\int \cos (x) \sin ^4(x) \, dx \\ & = i \text {Subst}\left (\int x^2 \left (1-x^2\right ) \, dx,x,\cos (x)\right )+\text {Subst}\left (\int x^4 \, dx,x,\sin (x)\right ) \\ & = \frac {\sin ^5(x)}{5}+i \text {Subst}\left (\int \left (x^2-x^4\right ) \, dx,x,\cos (x)\right ) \\ & = \frac {1}{3} i \cos ^3(x)-\frac {1}{5} i \cos ^5(x)+\frac {\sin ^5(x)}{5} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.05 (sec) , antiderivative size = 51, normalized size of antiderivative = 1.76 \[ \int \frac {\sin ^3(x)}{i+\tan (x)} \, dx=\frac {1}{8} i \cos (x)+\frac {1}{48} i \cos (3 x)-\frac {1}{80} i \cos (5 x)+\frac {\sin (x)}{8}-\frac {1}{16} \sin (3 x)+\frac {1}{80} \sin (5 x) \]

[In]

Integrate[Sin[x]^3/(I + Tan[x]),x]

[Out]

(I/8)*Cos[x] + (I/48)*Cos[3*x] - (I/80)*Cos[5*x] + Sin[x]/8 - Sin[3*x]/16 + Sin[5*x]/80

Maple [A] (verified)

Time = 4.87 (sec) , antiderivative size = 31, normalized size of antiderivative = 1.07

method result size
risch \(-\frac {i {\mathrm e}^{5 i x}}{80}+\frac {i {\mathrm e}^{-i x}}{8}+\frac {i \cos \left (3 x \right )}{48}-\frac {\sin \left (3 x \right )}{16}\) \(31\)
parallelrisch \(\frac {2 i}{15}+\frac {i \cos \left (3 x \right )}{48}+\frac {i \cos \left (x \right )}{8}-\frac {i \cos \left (5 x \right )}{80}+\frac {\sin \left (5 x \right )}{80}-\frac {\sin \left (3 x \right )}{16}+\frac {\sin \left (x \right )}{8}\) \(39\)
default \(\frac {i}{\left (\tan \left (\frac {x}{2}\right )+i\right )^{4}}+\frac {2}{5 \left (\tan \left (\frac {x}{2}\right )+i\right )^{5}}-\frac {2}{3 \left (\tan \left (\frac {x}{2}\right )+i\right )^{3}}-\frac {1}{8 \left (\tan \left (\frac {x}{2}\right )+i\right )}-\frac {i}{4 \left (\tan \left (\frac {x}{2}\right )-i\right )^{2}}+\frac {1}{6 \left (\tan \left (\frac {x}{2}\right )-i\right )^{3}}+\frac {1}{8 \tan \left (\frac {x}{2}\right )-8 i}\) \(81\)

[In]

int(sin(x)^3/(I+tan(x)),x,method=_RETURNVERBOSE)

[Out]

-1/80*I*exp(5*I*x)+1/8*I*exp(-I*x)+1/48*I*cos(3*x)-1/16*sin(3*x)

Fricas [A] (verification not implemented)

none

Time = 0.25 (sec) , antiderivative size = 26, normalized size of antiderivative = 0.90 \[ \int \frac {\sin ^3(x)}{i+\tan (x)} \, dx=\frac {1}{240} \, {\left (-3 i \, e^{\left (8 i \, x\right )} + 10 i \, e^{\left (6 i \, x\right )} + 30 i \, e^{\left (2 i \, x\right )} - 5 i\right )} e^{\left (-3 i \, x\right )} \]

[In]

integrate(sin(x)^3/(I+tan(x)),x, algorithm="fricas")

[Out]

1/240*(-3*I*e^(8*I*x) + 10*I*e^(6*I*x) + 30*I*e^(2*I*x) - 5*I)*e^(-3*I*x)

Sympy [A] (verification not implemented)

Time = 0.12 (sec) , antiderivative size = 37, normalized size of antiderivative = 1.28 \[ \int \frac {\sin ^3(x)}{i+\tan (x)} \, dx=- \frac {i e^{5 i x}}{80} + \frac {i e^{3 i x}}{24} + \frac {i e^{- i x}}{8} - \frac {i e^{- 3 i x}}{48} \]

[In]

integrate(sin(x)**3/(I+tan(x)),x)

[Out]

-I*exp(5*I*x)/80 + I*exp(3*I*x)/24 + I*exp(-I*x)/8 - I*exp(-3*I*x)/48

Maxima [F(-2)]

Exception generated. \[ \int \frac {\sin ^3(x)}{i+\tan (x)} \, dx=\text {Exception raised: RuntimeError} \]

[In]

integrate(sin(x)^3/(I+tan(x)),x, algorithm="maxima")

[Out]

Exception raised: RuntimeError >> ECL says: expt: undefined: 0 to a negative exponent.

Giac [B] (verification not implemented)

Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 71 vs. \(2 (19) = 38\).

Time = 0.33 (sec) , antiderivative size = 71, normalized size of antiderivative = 2.45 \[ \int \frac {\sin ^3(x)}{i+\tan (x)} \, dx=-\frac {-3 i \, \tan \left (\frac {1}{2} \, x\right )^{2} - 12 \, \tan \left (\frac {1}{2} \, x\right ) + 5 i}{24 \, {\left (-i \, \tan \left (\frac {1}{2} \, x\right ) - 1\right )}^{3}} - \frac {15 \, \tan \left (\frac {1}{2} \, x\right )^{4} + 60 i \, \tan \left (\frac {1}{2} \, x\right )^{3} - 10 \, \tan \left (\frac {1}{2} \, x\right )^{2} - 20 i \, \tan \left (\frac {1}{2} \, x\right ) + 7}{120 \, {\left (\tan \left (\frac {1}{2} \, x\right ) + i\right )}^{5}} \]

[In]

integrate(sin(x)^3/(I+tan(x)),x, algorithm="giac")

[Out]

-1/24*(-3*I*tan(1/2*x)^2 - 12*tan(1/2*x) + 5*I)/(-I*tan(1/2*x) - 1)^3 - 1/120*(15*tan(1/2*x)^4 + 60*I*tan(1/2*
x)^3 - 10*tan(1/2*x)^2 - 20*I*tan(1/2*x) + 7)/(tan(1/2*x) + I)^5

Mupad [B] (verification not implemented)

Time = 4.63 (sec) , antiderivative size = 59, normalized size of antiderivative = 2.03 \[ \int \frac {\sin ^3(x)}{i+\tan (x)} \, dx=-\frac {4\,\left (-{\mathrm {tan}\left (\frac {x}{2}\right )}^4\,15{}\mathrm {i}+6\,{\mathrm {tan}\left (\frac {x}{2}\right )}^3+{\mathrm {tan}\left (\frac {x}{2}\right )}^2\,2{}\mathrm {i}+2\,\mathrm {tan}\left (\frac {x}{2}\right )+1{}\mathrm {i}\right )}{15\,{\left (-1+\mathrm {tan}\left (\frac {x}{2}\right )\,1{}\mathrm {i}\right )}^5\,{\left (1+\mathrm {tan}\left (\frac {x}{2}\right )\,1{}\mathrm {i}\right )}^3} \]

[In]

int(sin(x)^3/(tan(x) + 1i),x)

[Out]

-(4*(2*tan(x/2) + tan(x/2)^2*2i + 6*tan(x/2)^3 - tan(x/2)^4*15i + 1i))/(15*(tan(x/2)*1i - 1)^5*(tan(x/2)*1i +
1)^3)